package com.jh.user.business;


import com.jh.user.pojo.Post;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;


@CacheConfig(cacheNames = "post")
public interface PostRepository extends PagingAndSortingRepository<Post, Integer> {


    public Post findById(int id);

    /**
     * 新增或修改时
     */

    @Override
   public Post save(Post post);

    @Transactional
    @Modifying
   public int deleteById(int id);

}
